@import './mixins/form-grid.scss';

*:not(svg *) {
	box-sizing: border-box;
	margin: 0;
	color: inherit;
	font-weight: inherit;
	font-size: inherit;
	font-family: inherit;
	line-height: inherit;
	tab-size: 2;
	user-select: none;
}

html {
	font-size: 14px;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
	color: var(--foreground-normal);
	font-weight: 500;
	font-size: 14px;
	font-family: var(--family-sans-serif);
	font-style: normal;
	line-height: 22px;
	background-color: var(--background-page);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	-moz-osx-font-smoothing: grayscale;

	&:not(.user-is-tabbing) * {
		outline: none;

		&::-moz-focus-inner,
		&::-moz-focus-outer {
			border: none;
			outline: none;
		}

		&:focus,
		&:focus-within {
			outline: none;
		}
	}
}

html,
body,
#root {
	width: 100%;
	height: 100%;
}

input,
textarea,
[contenteditable],
.selectable {
	user-select: text;

	* {
		user-select: text;
	}
}

::placeholder {
	opacity: 1;
}

:invalid {
	outline: 0;
	box-shadow: none;
}

button {
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 0;
	cursor: pointer;
}

label {
	display: block;
}

fieldset {
	padding: 10px 0 20px;
	border: 0;

	&.centered {
		border-top: 1px solid var(--blue-grey-200);

		legend {
			padding: 10px 20px;
			color: var(--blue-grey-400);
			text-align: center;
		}
	}
}

a {
	text-decoration: none;
}

strong {
	font-weight: 600;
}

code {
	font-family: var(--family-monospace);
}

::selection {
	background: var(--background-normal-alt);
}

dl > div {
	display: flex;
	margin-bottom: 8px;
}

dt,
dd {
	display: inline-block;
}

dt {
	flex-shrink: 0;
	margin-right: 8px;
	font-weight: 600;
}

dd {
	flex-grow: 1;
	overflow: hidden;
	color: var(--foreground-subdued);
	white-space: nowrap;
	text-overflow: ellipsis;
}

dd a {
	color: var(--primary);
}

.form-grid {
	@include form-grid;
}

input[type='number']::-webkit-inner-spin-button,
input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-results-button,
input[type='search']::-webkit-search-results-decoration {
	-webkit-appearance: none;
}
